<?php

require_once '../Model/DAL/AgentManagement.php';

class agentManagementController {

    private $model;

    function __construct() {
        $this->model = new AgentManagement();
    }

    function createUser() {
        $result = $this->model->createUser();
        echo json_encode($result);
    }

    function getAllPlayer() {
        $result = $this->model->getAllPlayer();
        return $result;
    }

    function getAllPlayerBalance() {
        $result = $this->model->getAllPlayerBalance();
        return $result;
    }

    function getAllSubPlayer() {
        //$arr = $this->model->getAllSubPlayer();
        //include_once '../View/templates/managements/agent/accounts/ct-account-player-list.php';
    }

    function getAccountBalance() {
        $arr = $this->model->getAccountBalance();
        return $arr;
    }

    function preChangePassword() {
        $arr = $this->model->getAccountBalance();
        return $arr;
    }

    function changepassword() {
        $result = $this->model->changepassword();
        echo $result;
    }

    function loadAccountDetail() {
        $arr = $this->model->loadAccountDetail();
        return $arr;
    }

    function updatePlayer() {
        $result = $this->model->updatePlayer();
        echo $result;
    }

    function getTopUserWin() {
        $result = $this->model->getTopUserWin();
        return $result;
    }

    function getTopUserLose() {
        $result = $this->model->getTopUserLose();
        return $result;
    }

    function getAllReportOfPlayer() {
        $result = $this->model->getAllReportOfPlayer();
        return $result;
    }

    function showHistoryReport() {
        $result = $this->model->showHistoryReport();
        return $result;
    }

    function chartRevenusDayByDay() {
        $arr = $this->model->getChartRevenusDayByDay();
        return $arr;
    }

    function chartRevenusDayByNoDay() {
        $arr = $this->model->getChartRevenusDayByNoDay();
        return $arr;
    }

    function chartRevenusDayByNoDay_Ajax() {
        $arr = $this->model->getChartRevenusDayByNoDay();
        return $arr;
    }

    //function chartRevenusYearWithMonthByYear() {
    //    $arr = array();
    //    $arr = $this->model->getChartRevenusYearWithMonthByYear();
    //    include_once '../View/templates/managements/agent/statistics/ct-revenus-year.php';
    //}

    function chartRevenusYearWithMonthByNoYear() {
        $arr = $this->model->getChartRevenusYearWithMonthByNoYear();
        return $arr;
    }

    function chartRevenusYearWithMonthByNoYear_Ajax() {
        $arr = $this->model->getChartRevenusYearWithMonthByNoYear();
        return $arr;
    }

    function chartRevenusWeekByNoDay() {
        $arr = $this->model->getChartRevenusWeekByNoDay();
        return $arr;
    }

    function chartRevenusWeekByNoDay_Ajax() {
        $arr = $this->model->getChartRevenusWeekByNoDay();
        return $arr;
    }

}
